package io;

import java.io.FileInputStream;
import java.io.ObjectInputStream;

/**
 * 对象反序列化
 * 将对象数据从文件中读入到程序中
 */
public class OISDemo {
    public static void main(String[] args) throws Exception {
        FileInputStream fis = new FileInputStream("./student.obj");
        ObjectInputStream ois = new ObjectInputStream(fis);
        Student s = (Student) ois.readObject();
        System.out.println(s);
    }
}
